package com.bwie.remote;

import com.bwie.common.domain.Role;
import com.bwie.common.domain.User;
import com.bwie.common.result.Result;
import com.bwie.remote.factory.UserRemoteFallBackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

/**
 * @className: UserRemote
 * @Description: TODO
 * @version: v1.８.0
 * @author: 刘鑫
 * @date: 2025/8/24 11:28
 */
@FeignClient(value = "bwie-system",fallbackFactory = UserRemoteFallBackFactory.class)
public interface UserRemote {
    @PostMapping("sysUser/login")
    public Result<User> login(@RequestBody User user);

    @GetMapping("sysUser/getRoleList/{userId}")
    public Result<List<Role>> getRoleList(@PathVariable("userId") Integer userId);

    /**
     * 查询用户的积分返回给前端
     * @param userId
     * @return
     */
    @GetMapping("sysUser/getUserIntegral/{userId}")
    public Result<User> getUserIntegral(@PathVariable("userId") Integer userId);
}
